package io.renren.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.entity.Shippercode;
import io.renren.entity.SysOrderEntity;
import io.renren.entity.SysProductEntity;
import io.renren.entity.SysProductSkuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-10 16:11:11
 */
@Mapper
public interface SysOrderDao extends BaseMapper<SysOrderEntity> {

    SysOrderEntity queryDetailById(Integer id);

    int deleteByOrderId(Integer orderId);

    List<Shippercode> queryexpressAllApi();

    void saveProducts(@Param("orderId") Integer orderId, @Param("products") List<SysProductSkuEntity> products);

    List<SysProductSkuEntity> selectProductList(@Param("orderId") Integer orderId,@Param("merchantId") Integer merchantId);

    int  updateStock(@Param("id") Integer id,@Param("stock") Integer stock);


    void updateStocks(@Param("storeId")Integer storeId, @Param("amount")Integer amount, @Param("pid")Integer pid);

    void updates(@Param("actualMoney") BigDecimal actualMoney, @Param("userId") Integer userId);

    void updateState(Integer orderId);
    /**
     * 拒单添加兑换券
     * @param actualMoney
     * @param userId
     */
    void coinCertificate(@Param("actualMoney")BigDecimal actualMoney, @Param("userId")Integer userId);

    /**
     * 拒单添加复肖积分
     * @param actualMoney
     * @param userId
     */
    void compoundRecord(BigDecimal actualMoney, Integer userId);
}
